Optimal. Leaf size=67 \[ \frac {c^2 x}{a^2}-\frac {4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac {4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.17, antiderivative size = 67, normalized size of antiderivative = 1.00, number of steps
used = 9, number of rules used = 6, integrand size = 26, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.231, Rules used = {3988, 3862,
4004, 3879, 3881, 3882} \begin {gather*} -\frac {4 c^2 \tan (e+f x)}{3 a^2 f (\sec (e+f x)+1)}-\frac {4 c^2 \tan (e+f x)}{3 a^2 f (\sec (e+f x)+1)^2}+\frac {c^2 x}{a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 3862
Rule 3879
Rule 3881
Rule 3882
Rule 3988
Rule 4004
Rubi steps
\begin {align*} \int \frac {(c-c \sec (e+f x))^2}{(a+a \sec (e+f x))^2} \, dx &=\frac {\int \left (\frac {c^2}{(1+\sec (e+f x))^2}-\frac {2 c^2 \sec (e+f x)}{(1+\sec (e+f x))^2}+\frac {c^2 \sec ^2(e+f x)}{(1+\sec (e+f x))^2}\right ) \, dx}{a^2}\\ &=\frac {c^2 \int \frac {1}{(1+\sec (e+f x))^2} \, dx}{a^2}+\frac {c^2 \int \frac {\sec ^2(e+f x)}{(1+\sec (e+f x))^2} \, dx}{a^2}-\frac {\left (2 c^2\right ) \int \frac {\sec (e+f x)}{(1+\sec (e+f x))^2} \, dx}{a^2}\\ &=-\frac {4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac {c^2 \int \frac {-3+\sec (e+f x)}{1+\sec (e+f x)} \, dx}{3 a^2}\\ &=\frac {c^2 x}{a^2}-\frac {4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac {\left (4 c^2\right ) \int \frac {\sec (e+f x)}{1+\sec (e+f x)} \, dx}{3 a^2}\\ &=\frac {c^2 x}{a^2}-\frac {4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))^2}-\frac {4 c^2 \tan (e+f x)}{3 a^2 f (1+\sec (e+f x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 67, normalized size = 1.00 \begin {gather*} \frac {c^2 \left (\frac {2 \text {ArcTan}\left (\tan \left (\frac {e}{2}+\frac {f x}{2}\right )\right )}{f}-\frac {2 \tan \left (\frac {e}{2}+\frac {f x}{2}\right )}{f}+\frac {2 \tan ^3\left (\frac {e}{2}+\frac {f x}{2}\right )}{3 f}\right )}{a^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.13, size = 47, normalized size = 0.70
method | result | size |
derivativedivides | \(\frac {2 c^{2} \left (\frac {\left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{f \,a^{2}}\) | \(47\) |
default | \(\frac {2 c^{2} \left (\frac {\left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3}-\tan \left (\frac {f x}{2}+\frac {e}{2}\right )+\arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )\right )}{f \,a^{2}}\) | \(47\) |
risch | \(\frac {c^{2} x}{a^{2}}-\frac {8 i c^{2} \left (3 \,{\mathrm e}^{2 i \left (f x +e \right )}+3 \,{\mathrm e}^{i \left (f x +e \right )}+2\right )}{3 f \,a^{2} \left ({\mathrm e}^{i \left (f x +e \right )}+1\right )^{3}}\) | \(59\) |
norman | \(\frac {\frac {c^{2} x \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{a}-\frac {c^{2} x}{a}+\frac {2 c^{2} \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{a f}-\frac {8 c^{2} \left (\tan ^{3}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 a f}+\frac {2 c^{2} \left (\tan ^{5}\left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{3 a f}}{a \left (\tan ^{2}\left (\frac {f x}{2}+\frac {e}{2}\right )-1\right )}\) | \(113\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 184 vs.
\(2 (67) = 134\).
time = 0.53, size = 184, normalized size = 2.75 \begin {gather*} -\frac {c^{2} {\left (\frac {\frac {9 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}}{a^{2}} - \frac {12 \, \arctan \left (\frac {\sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1}\right )}{a^{2}}\right )} - \frac {c^{2} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} + \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}} + \frac {2 \, c^{2} {\left (\frac {3 \, \sin \left (f x + e\right )}{\cos \left (f x + e\right ) + 1} - \frac {\sin \left (f x + e\right )^{3}}{{\left (\cos \left (f x + e\right ) + 1\right )}^{3}}\right )}}{a^{2}}}{6 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 2.86, size = 100, normalized size = 1.49 \begin {gather*} \frac {3 \, c^{2} f x \cos \left (f x + e\right )^{2} + 6 \, c^{2} f x \cos \left (f x + e\right ) + 3 \, c^{2} f x - 4 \, {\left (2 \, c^{2} \cos \left (f x + e\right ) + c^{2}\right )} \sin \left (f x + e\right )}{3 \, {\left (a^{2} f \cos \left (f x + e\right )^{2} + 2 \, a^{2} f \cos \left (f x + e\right ) + a^{2} f\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {c^{2} \left (\int \left (- \frac {2 \sec {\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\right )\, dx + \int \frac {\sec ^{2}{\left (e + f x \right )}}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx + \int \frac {1}{\sec ^{2}{\left (e + f x \right )} + 2 \sec {\left (e + f x \right )} + 1}\, dx\right )}{a^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.47, size = 60, normalized size = 0.90 \begin {gather*} \frac {\frac {3 \, {\left (f x + e\right )} c^{2}}{a^{2}} + \frac {2 \, {\left (a^{4} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 3 \, a^{4} c^{2} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )\right )}}{a^{6}}}{3 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 1.38, size = 38, normalized size = 0.57 \begin {gather*} \frac {2\,c^2\,\left ({\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )}^3-3\,\mathrm {tan}\left (\frac {e}{2}+\frac {f\,x}{2}\right )+\frac {3\,f\,x}{2}\right )}{3\,a^2\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________